package com.hanoi.wiki.model.json;

import java.io.Serializable;
import java.util.Date;

import org.codehaus.jackson.map.annotate.JsonSerialize;

import com.hanoi.wiki.common.DateSerializer;
import com.hanoi.wiki.model.User;
import com.hanoi.wiki.model.UserLog;

public class UserLogJson extends BaseJsonObject implements Serializable{
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	
	private int id;
	private Date updateTime;
	private String detail;
	private int status;
	private int user;
	
	public UserLogJson() {
		
	}
	
	public UserLogJson(UserLog userLog) {
		if(userLog != null) {
			this.id = userLog.getId();
			this.updateTime = userLog.getUpdateTime();
			this.detail = userLog.getDetail();
			this.status = userLog.getStatus();
			
			User user = userLog.getUser();
			if(user != null) {
				this.user = user.getId();
			}
		}
	}

	public int getId() {
		return id;
	}

	public void setId(int id) {
		this.id = id;
	}

	@JsonSerialize(using=DateSerializer.class)
	public Date getUpdateTime() {
		return updateTime;
	}

	public void setUpdateTime(Date updateTime) {
		this.updateTime = updateTime;
	}

	public String getDetail() {
		return detail;
	}

	public void setDetail(String detail) {
		this.detail = detail;
	}

	public int getStatus() {
		return status;
	}

	public void setStatus(int status) {
		this.status = status;
	}

	public int getUser() {
		return user;
	}

	public void setUser(int user) {
		this.user = user;
	}
	
	
}
